package com.esunny.resourcevisualization.domain.request;

import java.util.List;

/**
 * @version 1.0.0.0
 * @ClassName PageBean
 * @Description 分页信息
 * @Author baochencong
 * @Date 2020/12/7 13:20
 */
public class PageData<T> {

    /**
     * 当前页
     */
    private int currentPage;

    /**
     * 每页数量
     */
    private int pageSize;

    /**
     * 开始查询下标
     */
    private int startIndex;

    /**
     * 数据总量
     */
    private int totalSize;

    /**
     * 单页数据
     */
    private List<T> pageDataList;

    public int getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(int currentPage) {
        this.currentPage = currentPage;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getTotalSize() {
        return totalSize;
    }

    public void setTotalSize(int totalSize) {
        this.totalSize = totalSize;
    }

    public List<T> getPageDataList() {
        return pageDataList;
    }

    public void setPageDataList(List<T> pageDataList) {
        this.pageDataList = pageDataList;
    }

    public void setStartIndex() {
        this.startIndex = (this.currentPage-1)*this.pageSize;
    }

    public int getStartIndex() {
        return this.startIndex = (this.currentPage-1)*this.pageSize;
    }

    @Override
    public String toString() {
        return "PageData{" +
                "currentPage=" + currentPage +
                ", pageSize=" + pageSize +
                ", totalSize=" + totalSize +
                ", pageDataList=" + pageDataList +
                '}';
    }
}
